package com.qijian.maindata.domain.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.maindata.domain.ProcessOrder;
import com.qijian.maindata.domain.ProcessOrderQuality;
import com.qijian.maindata.domain.ProcessOrderUsers;
import com.qijian.tool.domain.Storage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 质量异常反馈对象
 *
 * @author qijian
 * @date 2023-08-02
 */

@Data
@ToString
public class ProcessOrderQualityVo extends ProcessOrderQuality {

    @ApiModelProperty(value = "质检附件")
    private List<Storage> qualifiedFiles;

    @ApiModelProperty(value = "附件")
    private List<Storage> reportFiles;



    @Excel(name = "工单管理人", sort = 11)
    @ApiModelProperty(value = "用户姓名")
    private String nickName;

    @Excel(name = "工单管理人所在车间", sort = 5)
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    /**
     * 所属工位
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "所属工位")
    private Long factoryId;

    /**
     * 来源
     */
    @ApiModelProperty(value = "来源")
    private String sourceId;

    /**
     * 工单编号
     */
    @Excel(name = "工单编号", sort = 1)
    @ApiModelProperty(value = "工单编号")
    private String workCode;

    /**
     * NCR编号
     */
    @Excel(name = "NCR编号",sort = 4)
    @ApiModelProperty(value = "NCR编号")
    private String ncrCode;

    /**
     * 派工类型
     */
    @NotNull(message = "派工类型不能为空")
    @Excel(name = "派工类型", dictType = "process_order_type",sort = 3)
    @ApiModelProperty(value = "派工类型")
    private String workType;


    /**
     * 物料名称
     */
    @NotNull(message = "物料不能为空")
    @Excel(name = "物料名称",sort = 9)
    @ApiModelProperty(value = "物料名称")
    private String itemName;


    /**
     * 工序名称
     */
    @NotNull(message = "工序不能为空")
    @Excel(name = "工序",sort = 10)
    @ApiModelProperty(value = "工序名称")
    private String processName;

    /**
     * 数量
     */
    @NotNull(message = "数量不能为空")
    @ApiModelProperty(value = "数量")
    private Integer workNumber;

    /**
     * 工序工时
     */
    @NotNull(message = "总工价不能为空")
    @Excel(name = "工时",sort = 11)
    @ApiModelProperty(value = "工序工时")
    private BigDecimal workTime;

    /**
     * 工序工价
     */
    @NotNull(message = "总工价不能为空")
    @Excel(name = "工价",sort = 12)
    @ApiModelProperty(value = "工序工价")
    private BigDecimal workCost;

    /**
     * 是否开发件
     */
    @Excel(name = "是否开发件",sort = 15)
    @ApiModelProperty(value = "是否开发件")
    private Boolean isDevelop;

    /**
     * 开始时间
     */
    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始时间")
    private Date workStartTime;

    /**
     * 结束时间
     */
    @NotNull(message = "结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束时间")
    private Date workEndTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "派单时间")
    private Date dispatchTime;

    @ApiModelProperty(value = "是否检验")
    private Boolean isCheck;

    @ApiModelProperty(value = "是否关闭")
    private Boolean isClose;

    private List<ProcessOrderUsers> users;

    private  String projectNo;

    private  String machineNo;

    private  String itemCode;

    private  Integer approveStatus;

}
